package com.forenow.demo1;

public class Book {
    private int id;
    private String name;
    private double price;
    private int num;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }
    public  Book[]  method(){
        Book[] array = new Book[3];
        Book bk1 =  new  Book();
        bk1.setId(1);
        bk1.setName("java");
        bk1.setPrice(33.45);
        bk1.setNum(50);
        Book bk2 =  new  Book();
        bk2.setId(2);
        bk2.setName("jsp");
        bk2.setPrice(55.45);
        bk2.setNum(150);
        Book bk3 =  new  Book();
        bk3.setId(3);
        bk3.setName("ssm");
        bk3.setPrice(77.45);
        bk3.setNum(250);
        array[0]=bk1;
        array[1]=bk2;
        array[2]=bk3;
        return array;
    }

}
